﻿/**********************************************************************
 * @file   OperSEASubSystemAutoCavityGen.h
 * @brief  SEA子系统自动生成声腔操作器
 * @author liuzhonghua (liuzhonghuaszch@163.com)
 * @date   2024-11-18
 *********************************************************************/
#ifndef _OperSEASubSystemAutoCavityGen_H
#define _OperSEASubSystemAutoCavityGen_H

#include "FITK_Kernel/FITKCore/FITKActionOperator.h"
#include "FITK_Kernel/FITKCore/FITKOperatorRepo.h"
#include "FITK_Kernel/FITKCore/FITKThreadTask.h"

namespace ModelOper
{
    /**
     * @brief 子系统创建操作器
     * @author liuzhonghua (liuzhonghuaszch@163.com)
     * @date   2024-10-23
     */
    class OperSEASubSystemAutoCavityGen :public Core::FITKActionOperator
    {
        Q_OBJECT;
    public:
        /**
         * @brief Construct a new Operators Create SubSystem object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-10-23
         */
        explicit OperSEASubSystemAutoCavityGen() = default;
        /**
         * @brief Destroy the Operators Create SubSystem object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-10-23
         */
        virtual ~OperSEASubSystemAutoCavityGen() = default;
        /**
         * @brief 执行
         * @return true 成功
         * @return false 失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-10-23
         */
        virtual bool execGUI() override;
        /**
         * @brief 执行结果处理
         * @return true 成功
         * @return false 失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-10-23
         */
        virtual bool execProfession() override;
    };

    /**
     * @brief  自动生成声腔线程
     * @author liuzhonghua (liuzhonghuaszch@163.com)
     * @date   2024-11-18
     */
    class RecogClosedCavityThread :public Core::FITKThreadTask
    {
        Q_OBJECT;
    public:
        /**
         * @brief Construct a new RecogClosedCavityThread object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-10-23
         */
        explicit RecogClosedCavityThread(Core::FITKActionOperator* oper);
        /**
         * @brief Destroy the RecogClosedCavityThread object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-10-23
         */
        virtual ~RecogClosedCavityThread() = default;
        /**
         * @brief 执行函数
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-10-23
         */
        void run();

    protected:
        /**
         * @brief    自动生成声腔的操作
         * @return   QList<int>
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-13
         */
        QList<int> autoGenerateCavityOper();

    private:
        /**
         * @brief  操作器
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-11-22
         */
        Core::FITKActionOperator* _oper{};
    };
    // 按钮注册相关操作
    Register2FITKOperatorRepo(actionAutoGenerateCavity, OperSEASubSystemAutoCavityGen);
}

#endif